package com.ffapp.demo.bean;

import android.os.Bundle;
import android.text.TextUtils;

import com.ffapp.demo.R;
import com.ffapp.demo.basis.BasisActivity;
import com.ffapp.demo.chemicals.ChemicalListActivity;
import com.ffapp.demo.contact.ContactListActivity;
import com.ffapp.demo.notice.NoticeListActivity;
import com.ffapp.demo.other.WebViewX5Activity;
import com.ffapp.demo.statis.StatisTabActivity;
import com.ffapp.demo.video.VideoIndexActivity;

import my.ActivityTool;

public class HomeGrideListData extends BasisBean {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    public static final String CLASSIFY_BASEINFO = "10", CLASSIFY_COMMAND = "20", CLASSIFY_COLLECT = "30", CLASSIFY_OTHER = "99"
            , CLASSIFY_FORMAL_BUILD = "40"
            ,CLASSIFY_KNOWLEGE= "50"
            ;


    /**
     * id : APP_TZGGLB
     * createBy : system
     * createUserName : system
     * createTime : 2020-03-27 16:11:56
     * updateBy : system
     * updateUserName : system
     * updateTime : 2020-03-27 16:11:56
     * name : 通知公告列表
     * url : null
     * icon : null
     * component : null
     * parentId : TYPE_APP_ROOT
     * fullPath : -1,TYPE_APP_ROOT,APP_TZGGLB
     * moudleOrder : 203
     * projectNo : 1190001
     * moduleType : 10
     * status : 1
     * customed : 0
     * iconUrl : http://192.168.25.236null
     * classify : null
     * noPrefiUrl : null
     */

    private String id;
    private String createBy;
    private String createUserName;
    private String createTime;
    private String updateBy;
    private String updateUserName;
    private String updateTime;
    private String name;
    private String url;
    private String icon;
    private String component;
    private String parentId;
    private String fullPath;
    private int moudleOrder;
    private String projectNo;
    private String moduleType;
    private String status;
    private String customed;
    private String iconUrl;
    private String classify;
    private String noPrefiUrl;
    private String unReadCountMsg;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateUserName() {
        return updateUserName;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getFullPath() {
        return fullPath;
    }

    public void setFullPath(String fullPath) {
        this.fullPath = fullPath;
    }

    public int getMoudleOrder() {
        return moudleOrder;
    }

    public void setMoudleOrder(int moudleOrder) {
        this.moudleOrder = moudleOrder;
    }

    public String getProjectNo() {
        return projectNo;
    }

    public void setProjectNo(String projectNo) {
        this.projectNo = projectNo;
    }

    public String getModuleType() {
        return moduleType;
    }

    public void setModuleType(String moduleType) {
        this.moduleType = moduleType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCustomed() {
        return customed;
    }

    public void setCustomed(String customed) {
        this.customed = customed;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public String getClassify() {
        return classify;
    }

    public static String getClassifyName(String classify) {
        switch (classify) {
            case CLASSIFY_BASEINFO:
                return "基础信息";
            case CLASSIFY_COLLECT:
                return "数据采集";
            case CLASSIFY_COMMAND:
                return "智慧调度应用";
            case CLASSIFY_OTHER:
                return "其他";
            case CLASSIFY_FORMAL_BUILD:
//                return "队务管理";
                return "正规化应用";
            case CLASSIFY_KNOWLEGE:
                return "知识库";
        }
        return "其他";
    }

    public void setClassify(String classify) {
        this.classify = classify;
    }

    public String getNoPrefiUrl() {
        return noPrefiUrl;
    }

    public void setNoPrefiUrl(String noPrefiUrl) {
        this.noPrefiUrl = noPrefiUrl;
    }

    public void onItemClick(BasisActivity mContext) {
        Bundle bundle;
        switch (getName()) {
            default:
                switch (id) {

                    case "APP_TXL":
                        ActivityTool.skipActivity(mContext, ContactListActivity.class);
                        break;
                    case "APP_TJFX_ROOT":
                        ActivityTool.skipActivity(mContext, StatisTabActivity.class);
                        break;
                    case "APP_WHP":
                        ActivityTool.skipActivity(mContext, ChemicalListActivity.class);
                        break;
                    case "APP_TZGG":
                        ActivityTool.skipActivity(mContext, NoticeListActivity.class);
                        break;
                    case "APP_VIDEO":
                        ActivityTool.skipActivity(mContext, VideoIndexActivity.class);
                        break;
                    default:
                        if (!TextUtils.isEmpty(getUrl())) {
                            WebViewX5Activity.toWebView(mContext, getUrl(), getName());
                        } else {
                            mContext.showToast(R.string.app_building);
                        }
                        break;
                }
                break;
        }

    }

    public String getUnReadCountMsg() {
        return unReadCountMsg;
    }

    public void setUnReadCountMsg(String unReadCountMsg) {
        this.unReadCountMsg = unReadCountMsg;
    }
}
